<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html >
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>FTP帐号创建系统</title>
	<link rel="stylesheet" href="<%=path %>/css/public.css" type="text/css"  />
	<link rel="stylesheet" href="<%=path %>/css/module.css" type="text/css"  />
	<link rel="stylesheet" href="<%=path %>/css/skin_blue.css" type="text/css"  />
	<script type="text/javascript" src="<%=path %>/js/json.js"></script>
	<script type="text/javascript" src="<%=path %>/js/util.js"></script>
	<script type="text/javascript">
		function add_update(add_update){
			var param={
			};
			if(add_update=='1'){//新增
				param.id='0';
			}else{
				var checkObj=getObjsByName('sysUserChx');
				var checks=new Array();
				for(var i=0;i<checkObj.length;i++){
					if(checkObj[i].checked){
						checks.push(checkObj[i]);
					}
				}
				if(add_update=='2'){//修改
					if(checks.length!=1){
						alert('请选择一个收件人进行修改！');
						return ;
					}
					alert(checks[0].id);
					param.id=checks[0].id;
				}else{//删除
					if(checks.length<1){
						alert('请选择需删除的收件人！');
						return ;
					}
					var ids='';
					for(var i=0;i<checks.length;i++){
						ids+=checks[i].id;
						ids+=',';
					}
					param.ids=ids;
					getObjById('frmReceiver').action="<%=path %>/ftp!deleteSysUsers.action";
				}
			}
			getObjById('requestData').value=Ext.util.JSON.encode(param);
			getObjById('frmReceiver').submit();
		}
	</script>
  </head>
  
  <body>
  <form action="<%=path %>/ftp!receiverMaintain.action" id="frmReceiver" enctype="multipart/form-data" method="post">
  		<input type="hidden" id="requestData" name="requestData">
  </form>
  <div class="toolbox">
  <div class="buttonbox">
	<ul>
		<li>
			<a id="add" class="btn_zj" onclick="add_update(1);">
				新 增
			</a>
		</li>
		<li>
			<a id="search" class="btn_xg" onclick="add_update(2);">
				修改
			</a>
		</li>
		<li>
			<a id="delete" class="btn_sc" onclick="add_update(3);">
				删 除
			</a>
		</li>
	</ul>
	</div>
	</div>
 <div class="formbox">
  <table summary="" class="datelist"  width="100%">
		<thead>
			<tr>
				<th  width="10%" >
					
				</th>
				<td width="15%">收件人姓名</td>
				<td width="30%">收件人邮箱</td>
				<td width="45%">备注</td>
			</tr>
		</thead>
      
		<tbody>
			<s:iterator value="pageBean.list" id="sysUser">
				<tr>
					<th ><input type="checkbox" id="<s:property value="#sysUser.id" />" name="sysUserChx"/></th>
					<td><s:property value="#sysUser.username" /></td>
					<td><s:property value="#sysUser.mail" /></td>
					<td><s:property value="#sysUser.description" /></td>
				</tr>
			</s:iterator>
		</tbody>
  </table>
  </div>
  </body>
</html>
